package com.ada.data.mybatis.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import com.ada.data.mybatis.domain.Data;
import com.ada.data.mybatis.domain.User;
import com.ada.data.mybatis.mapper.UserMapper;
import com.ada.data.mybatis.service.UserService;

@Component
@Transactional
public class UserServiceImpl implements UserService {

	@Autowired
	UserMapper mapper;

	public int add(User user) {
		// TODO Auto-generated method stub
		return mapper.insert(user);
	}

	public List<User> find() {
		// TODO Auto-generated method stub
		return null;
	}

	public User findById(Long id) {
		// TODO Auto-generated method stub
		return mapper.selectByPrimaryKey(id);
	}

	@Override
	public List<Data> selectdatas(int limit) {
		// TODO Auto-generated method stub
		return mapper.selectdatas(limit);
		//return null;
	}

}
